How Programmable Logic Controller Works

How Programmable Logic Controller (PLC) Works | Components, CPU, I/O & Programming BasicsπŸ€–

Welcome to Insight Control System Blog PageπŸ“–

INTRODUCTION

A Programmable Logic Controller (PLC) is an industrial digital computer used to control machines, manufacturing processes, and automation systems. PLCs are widely used in industries due to their reliability, flexibility, and ability to operate in harsh industrial environments.

Programmable Logic Controller
How Programmable Logic Controller Works

This article explains how a PLC works, covering its history, components, working principle, inputs and outputs, CPU functions, HMI, and programming concepts. It is intended for students, technicians, engineers, and automation professionals who want a clear and practical understanding of PLC fundamentals used in modern industrial automation.⚙️

πŸ“Œ ARTICLE CONTENTS

  1. What is a Programmable Logic Controller (PLC)?
  2. History of PLC
  3. PLC Components
  4. How a PLC Works (PLC Scan Cycle)
  5. Central Processing Unit (CPU)
  6. PLC Inputs and Outputs
  7. Input Devices
  8. Output Devices
  9. Human Machine Interface (HMI)
  10. Programming Device
  11. PLC Programming Concepts (IEC 61131-3)
  12. Conclusion

What is a PLC?

  • Most factories contain dozens or even hundreds of machines, from the very simple to the complex. Some are still operated and controlled only by skilled workers.
  • However, most complex machines rely on programmable logic controllers, PLC'S for short A PLC is an industrial computer that is used to control machines and processes.
  • PLC'S differ from office computers in the types of tasks that they perform and the hardware and software they require.
How Programmable Logic Controller Works
What is a PLC
  • While the specific applications vary widely, all PLC'S get inputs from switches and sensors, make decisions based on a stored program, and control outputs to automate machines and processes.
  • Before PLC'S were invented, machines were often controlled by Electro-mechanical devices with complex wiring. This approach is called hard-wired control.
  • Hard-wired control is still used for simple tasks, but for larger applications it is difficult to design, install, and maintain.
  • Because tasks performed by PLC'S are controlled by software and internally stored values, use of PLC'S offers exceptional flexibility.
  • As a result, PLC'S are now used to run almost any industrial application, and almost every new machine that comes into a factory has a PLC controlling it. Consequently, many industrial jobs require knowledge of PLC'S.

History of PLC'S:

  • The very first PLC'S were designed for use in the automotive industry in the late 1960s.
  • Prior to that time, control of an auto assembly line relied heavily on Electromechanical Relays, Contactors, Timers, and Related devices.
  • Every year, as design changes were made to different car models, these circuits had to be rewired.
How Programmable Logic Controller Works
History of PLC'S
  • Rewiring circuits was a complicated and time- consuming task, and even when the relays performed well initially, the wear on all those physical contacts resulted in costly maintenance.
  • Additionally, as manufacturing processes became more and more complicated, more relay circuits were needed. This resulted in even greater cost and complexity.
  • Because the hard-wired circuits replaced by PLC'S used control circuit diagrams referred to as ladder diagrams, early PLC'S used ladder diagram software programs, sometimes referred to as ladder logic, to make it easier for someone familiar with control circuits to program a PLC.
  • Unfortunately, every PLC manufacturer had its own version of ladder diagram programming.
How Programmable Logic Controller Works
PLC manufacturer
  • This variation in programming grew as PLC'S were developed to handle a wider range of tasks. Today, most PLC'S can still use ladder diagram programming, but the IEC61131 international standard now defines this PLC programming language.
  • This same standard also defines other types of programming languages available for PLC'S, so that they can be used for the most complex applications.
  • In addition, even a small PLC can easily outperform hard-wired Electromechanical circuits.

PLC Components

  • Most PLC'S have a modular structure. Some PLC'S have a block-type modular structure, but the majority have a traditional modular structure.
  • Despite their variation in appearance, modular PLC'S have a similar organization which includes the following components:
  • The Central Processing Unit (CPU) is the brains of the PLC. 
  • The CPU stores and runs the user program.
  • The input/output system (often referred to as the I/O system) includes modules with I/O channels that connect to input devices such as switches and sensors and output devices that are controlled by the PLC.
How Programmable Logic Controller Works
PLC Components
  • A programming device is used to load the program into the CPU memory. The programming device is usually an industrial personal computer with software that allows you to create and modify PLC programs.
  • The programming device is only connected to the PLC when it is needed. Although not part of a PLC, one or more human machine interfaces (HMI'S) are often connected to a PLC to allow factory personnel to monitor or alter a machine or process.

How a PLC Works

  • PLC I/O devices are sometimes the same as devices used in hard-wired control circuits, but the relationship of these devices is determined by software referred to as the user program which is stored in the CPU.
  • This program is executed repetitively as part of a process referred to as a scan.
  • After start-up, a PLC scan includes the following sequence of operations. The CPU reads the statuses of input devices and records this information in its memory.
How Programmable Logic Controller Works
How a PLC Works
  • The CPU executes the user program and changes internal memory values as needed. The CPU performs internal diagnostic and communication tasks.
  • The CPU sends updated status information to output devices through the I/O system.
  • This process is repeated continuously as long as the PLC is in the run mode.
  • The time required for a scan depends on the capabilities of the CPU, the size of the user program, the number of I/O’s, and the amount of communication required; however, because PLC'S are very fast, a typical PLC scan is measured in milliseconds.
  • This means that the PLC response time from reading an input to reacting by changing an output is also very fast.

Central Processing Unit (CPU)

  • A central processing unit (CPU), is the brains of a PLC. The CPU stores the user program, I/O status bits, and other data.
  • It also repetitively executes the PLC scan as previously described.
  • As part of this scanning process, the CPU receives input information from input channels and sends output information to output channels.
  • SIMATIC S7-1200 CPU'S have a small number of I/O channels in the same housing.
  • Most of these CPU'S also have the capability to connect to I/O signal modules for additional I/O channels.
  • Most other SIMATIC PLC'S have all I/O channels on I/O signal modules.
  • Both S7-1200 and S7-1500 CPU'S have one or more communication connections, referred to as ports.
How Programmable Logic Controller Works
SIMATIC PLC'S
  • A communication port is designed for a specific type of communications.
  • When a different type of communications is required or when additional communication ports are required, one or more communication modules are used.

PLC Inputs and Outputs

  • Input devices are usually switches or sensors that send electrical signals to the CPU through input channels on input signal modules.
  • Similarly, output devices receive electrical signals from the CPU through output channels on output signal modules.
  • These output devices are sometimes called actuators and are used to control a machine or process.
  • PLC'S have two broad categories of I/0, digital and analog. Digital I/O devices, also called discrete I/O devices, are either on or off and are connected to digital I/ O channels.
How Programmable Logic Controller Works
PLC Inputs and Outputs
  • Analog I/O devices use variable voltage or current signals and are connected to analog I/O channels. Analog I/O is used in applications where variable quantities, such as temperature, pressure, rate of flow, etc., are being controlled or monitored.

Input Devices

  • Digital input devices provide an on or off signal to a digital input signal module in response to an operator input or a change in condition in a machine or process.
  • The input device may operate on direct current (DC) or alternating current (AC), and the voltage and current level is dependent on the type of device.
How Programmable Logic Controller Works
Input Devices
  • A digital input signal module converts this value to a low-level DC signal that represents the on or off condition of the input device. 
  • For each digital input device, the latest on or off condition is stored in the CPU.
  • Analog input devices provide a variable voltage or current to an analog input signal module.
  • This variable voltage or current represents a condition in a machine or process such as temperature, pressure, vibration, rate of flow, weight, fluid level, etc.
  • An analog input signal module converts each current or voltage value to a low-level DC signal and sends it to the CPU.
  • For each analog input device, the latest value received from the device is stored as a number in the CPU.

Output Devices

  • Digital output devices are turned on or off by signals from digital output signal modules.
  • For example, an indicator light on an operator panel may be turned on to indicate that a machine is running.
  • Often, however, the digital output device is used to cause a change in a machine or process, such as starting or stopping a motor or pump.
  • Analog output devices receive a variable voltage or current signal from an analog output signal module.
How Programmable Logic Controller Works
Output Devices
  • For example, an analog meter on an operator panel could be used as an analog output device to show a condition in a machine or process.
  • Often, however, an analog output device is used to control a machine or process.
  • For example, analog outputs from a PLC could be used to control AC drives which, in turn, control pumps that fill and drain a storage tank.

Human Machine Interfaces (HMI)

  • Input and output devices are often used to interconnect panels with lights and switches to one or more PLC'S so that operation and maintenance personnel can monitor and control a machine or process.
  • Increasingly, human machine interfaces are also used for similar purposes.
  • HMI panels range in capability from simple keypad devices to panels with the ability to graphically display an entire process.
  • An HMI can also be a mobile device that allows freedom of movement for operation or maintenance personnel.

Programming Device

  • A programming device is often a personal computer (PC) with software that enables it to program a PLC.
  • Often an industrialized PC is used so that it can function reliably in a factory environment.
  • The programming device frequently has additional functionality depending on the software used.
How Programmable Logic Controller Works
Totally Integrated Automation Portal
  • For example, a programming device running Siemens Totally Integrated Automation Portal (TIA Portal) software is used in all phases of the design, operation, and maintenance of systems that can include PLC'S, HMI'S, PCs, electronic drives, and related devices.

Programming Concepts

  • There are multiple ways to program a PLC. At one time, PLC programming languages varied with the PLC manufacturer.
  • In general, however, PLC'S manufactured in recent years are programmed using a language defined in an international specification, IEC 61131.
How Programmable Logic Controller Works
International Electrotechnical Commission
  • There are 5 languages that are all a part of the IEC (International Electrotechnical Commission) Section 61131-3 Standard. This IEC Standard allows some ground rules that standardize PLC's and their languages. 
The 5 most popular PLC Programming Languages are:
  1. Ladder Diagram (LD)
  2. Sequential Function Charts (SFC)
  3. Function Block Diagram (FBD)
  4. Structured Text (ST)
  5. Instruction List (IL)

Ladder Diagram (LD)

  • Ladder Diagram was originally modelled from relay-logic which used physical devices, such as switches and mechanical relays to control processes.
  • Ladder Diagram utilizes internal logic to replace all, except the physical devices that need an electrical signal to activate them.
How Programmable Logic Controller Works
Ladder Diagram (LD)
  • Ladder Diagram is built in the form of horizontal rungs with two vertical rails that represent the electrical connection on relay-logic schematics.
  • You can program all the necessary input conditions to affect the output conditions, whether logical or physical.

Sequential Function Charts (SFC)

  • In Sequential Function Charts, you use steps and transitions to achieve your end results.
  • Steps act as a major function in your program. These steps house the actions that occur when you program them to happen.
How Programmable Logic Controller Works
Sequential Function Charts (SFC)
  • This decision can be based on timing, a certain phase of the process, or a physical state of an equipment.
  • Transitions are the instructions that you use to move from one step to another step by setting conditions of true or false.

Function Block Diagram (FBD)

  • The Function Block Diagram which is also a graphical type of language.
  • The Function Block Diagram describes a function between inputs and outputs that are connected in blocks by connection lines.
  • Function Blocks were originally developed to create a system that you could set up many of the common, repeatable tasks, such as counters, timers, PID Loops, etc.
How Programmable Logic Controller Works
Function Block Diagram (FBD)
  • You program the blocks onto sheets and then the PLC constantly scans the sheets in numerical order or is determined by connections which you program between the blocks.

Structured Text (ST)

  • This language is a textual based language.
  • Structured Text is a high-level language that is like Basic, Pascal and “C”.
  • It is a very powerful tool that can execute complex tasks utilizing algorithms and mathematical functions along with repetitive tasks.
How Programmable Logic Controller Works
Structured Text (ST)
  • The code uses statements that are separated by semicolons and then either inputs, outputs, or variables are changed by these statements.
  • You must write out each line of code and it uses functions such as FOR, WHILE, IF, ELSE, ELSEIF AND CASE.

Instruction List (IL)

  • The Instruction List is also a textual based language.
  • The Instruction List language resembles assembly language. 
  • When you use this PLC Programming Language, you will use mnemonic codes such as LD (Load), AND, OR, etc.
How Programmable Logic Controller Works
Instruction List (IL)
  • The Instruction List contains instructions with each instruction on a new line with any comments you might want to annotate at the end of each line.
  • Two of the programming languages defined in this specification are ladder diagram and function block diagram.

⭐ Why PLCs Are Preferred in Industrial Automation

  • High reliability in harsh environments
  • Easy troubleshooting
  • Flexible programming
  • Reduced wiring compared to relay logic
  • Faster response time
  • Easy expansion and modification

⭐ Typical PLC Applications

  • Conveyor systems
  • Packaging machines
  • Water treatment plants
  • Manufacturing automation
  • Process control industries

✅ Conclusion

Programmable Logic Controllers (PLCs) play a critical role in modern industrial automation by providing reliable, flexible, and efficient control of machines and processes. 
By understanding how a PLC works from input processing and CPU operation to output control and programming languages engineers and technicians can design, operate, and maintain automation systems more effectively.πŸ“˜

With standardized programming languages defined by IEC 61131-3 and continuous advancements in hardware and software, PLCs remain the backbone of industrial control systems worldwide. 
Mastering PLC fundamentals is an essential skill for anyone pursuing a career in automation and control engineering.⚙️

πŸ“Ž Related: Danfoss FC-102 LCP Simulator Tool

πŸ“Ž Related: Boiler Types and Classifications for Industrial and Commercial Use

πŸ“Ž Related: Top 100+ Building Automation System Abbreviations and Their Meanings Part 1

πŸ“Ž Related: QElectro Tech Software: Free Electrical Diagram Tool – Full Overview & Guide

πŸ“Ž Related: PLC Basic Instructions Explained | Essential Allen-Bradley MicroLogix & PLC-5 Ladder Logic Functions


🌐 Follow Us Online

       

Comments